package cn.kaiux.bigdata.homework.week07_08

import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Sort}
import org.apache.spark.sql.catalyst.rules.Rule

/**
 * @author kaiux@foxmail.com
 * @date 2022/6/25 15:53
 */
case class MyPushDown(spark: SparkSession) extends Rule[LogicalPlan] {

  def apply(plan: LogicalPlan): LogicalPlan = plan transform {
    case Sort(_, _, child) =>
      print("yulikai's push down matched\n")
      child
    case other =>
      print("yulikai's push down\n")
      other
  }

}
